package com.zyy.meetObject2;

public class account {
    private double balance;

    public account(double init_balance) {
        this.balance = init_balance;
    }

    public double getBalance() {
        return balance;
    }
    public void  deposit(double amt){
        if(amt > 0){
            balance += amt;
            System.out.println("成功存入：" + amt);
        }
    }

    public void withdraw(double amt){
        if(balance >= amt&& amt > 0){
            balance -= amt;
            System.out.println("成功取出：" + amt);
        }else{
            System.out.println("取款数额有误或余额不足");
        }

    }

}
